home *** CD-ROM | disk | FTP | other *** search
- Numeric Input Line Demonstration
- Copyright (C) 1992 by James H. Price, all rights reserved
-
- Introduction
-
- This program gives an example of specializing TInputLine to accept
- numeric input only. Most of the work is done in a pure virtual,
- template base class, NumInputLine, from which input classes are for
- integers and doubles are derived. Deriving further classes for
- floats, longs, etc. is trivial.
-
- The demo consists of the following files:
-
- NUMINP.H Header file for NumInputLine classes
- NUMINP.CPP Member functions for NumInputLine classes
- INPTEST.CPP A simple TurboVision demo program
- INPTEST.PRJ Project file for the demo
- README This file
-
-
- Operation:
-
- NumInputLine masks keyboard input to prevent non-numeric characters
- from being entered. The mask type is set as an argument to the
- NumInputLine constructor. See the top of the header file for an
- explation of the masks.
-
- In addition to input masking, NumInputLine overrides getData(),
- setData(), and dataSize() to accept and return objects of the desired
- type.
-
-
- Limitations:
-
- No bounds or overflow checking is performed, other than limiting the
- length of the input string. In fact, virtually no error checking of
- any sort is done, since this is intended more as a demonstration that
- a piece of industrial-strength code.
-
-
- Other:
-
- I'll be happy to answer questions about the program, but I don't
- intend to really 'support' it. Extending and/or maintaining the code
- is left as an exercise for the user!
-
- Any rights which Borland may have to TurboVision-based code remain in
- force. Otherwise, feel free to use this code as you see fit. I'm
- reasonably certain that it works as described, but of course, you use
- it at your own risk. If you distribute this as source code, please
- include this file.
-
- Jim Price 76264,3534
- 28 Aug 92
-